/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bols;

import entity.Order2;
import entity.Product2;
import entity.User2;
import facade.Order2FacadeRemote;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 *
 * @author lab1
 */
public class BOLOrder {

    Order2FacadeRemote order2Facade = lookupOrder2FacadeRemote();

    private Order2FacadeRemote lookupOrder2FacadeRemote() {
        try {
            Context c = new InitialContext();
            return (Order2FacadeRemote) c.lookup("java:global/SHOPPINGCART2/SHOPPINGCART2-ejb/Order2Facade!facade.Order2FacadeRemote");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }
    //insert Cart vao Database khi Employee Check Outf
    public void insertOrder2(Order2 or) {
        order2Facade.create(or);
    }
}
